package org.celery.modules.shop.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.celery.modules.shop.entity.Shop;
import org.celery.modules.shop.vo.ShopVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 店铺表 服务类
 *
 * @author Celery
 * @since 2023-06-12
 */
public interface IShopService extends BaseService<Shop> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param shop
	 * @return
	 */
	IPage<ShopVO> selectShopPage(IPage<ShopVO> page, ShopVO shop);

	Boolean addShop(Shop shop);

	Boolean modifyShop(Shop shop);

	Boolean deleteShop(Long shopId);

	Shop getShopById(Long orderId);

	IPage<Shop> getShopList(Shop order, Query query);

	/**
	 * 增加返回下拉列表的shop选择
	 */
	List<HashMap<String, String>> getShopSelect(String name, BladeUser user);

	/**
	 * 获取文件内容
	 */
	ArrayList<String> getFileContent(String filePath) throws IOException;

	/**
	 * 读取自定义文件配置，方便自主创建对应的用户
	 */
	HashMap<String, String> getCustomProperties();

	List<Shop> authList(BladeUser user);

	QueryWrapper<Shop> authWrapper(QueryWrapper<Shop> queryWrapper, BladeUser user);

	Map<String, Object> shopUserInfo(Long shopId);
}
